package cn.NewsServiceImpl;

import cn.NewsDao.NewsDao2;
import cn.NewsService.NewsService2;
import cn.entity.News2;


import java.util.List;

public class NewsServiceImpl2 implements NewsService2 {
    private NewsDao2 newsDao;

    public NewsDao2 getNewsDao() {
        return newsDao;
    }

    public void setNewsDao(NewsDao2 newsDao) {
        this.newsDao = newsDao;
    }

    @Override
    public boolean updateNews(News2 news) {
        return newsDao.update(news);
    }

    @Override
    public boolean addNews(News2 news) {
        return newsDao.add(news);
    }

    @Override
    public boolean deleteNews(int id) {
        return newsDao.delete(id);
    }

    @Override
    public List<News2> getNewsList() {
        return newsDao.getNewsList();
    }
}
